﻿@model IEnumerable<MStack.Infrastructure.Entities.Topic>

<h2>最新热门帖子</h2>
<table class="table table-striped table-hover table-data">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Title)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Category)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Author)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Replies)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Views)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.PublishDateTime)
            </th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.ActionLink(item.Title, "Detail", new { id = item.Id })
                </td>
                <td>
                    @item.Category.ToString()
                </td>
                <td>
                    @Html.DisplayFor(modelItem => (item.Author ?? new MStack.Infrastructure.Entities.User()).UserName)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Replies)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Views)
                </td>
                <td>
                    @item.PublishDateTime.ToString("yyyy年MM月dd日 HH:mm:ss")
                </td>
            </tr>
        }
    </tbody>
</table>

